/*
 * ASTNodeList.h
 *
 *  Created on: 20 May 2010
 *      Author: Guobc
 */

#ifndef ASTNODELIST_H_
#define ASTNODELIST_H_

#include "ASTNode.h"
#include <vector>
using namespace std;

namespace HA {
class ASTNode;
class ASTNodeList {
public:

	ASTNodeList();

	inline void append(ASTNode* node){
		children.push_back(node);
	}
	/**
	 * Return the indexth item in the list. If the number is greater than or equal
	 * the numbers of nodes in the list, this return NULL.
	 * @param index Index into the list
	 * @return An node in the list, or NULL if invalid index
	 */
	ASTNode* item(int index) const;

	/**
	 * The number of nodes in the list. The range of valid child node indices
	 * is 0 to length-1 inclusive.
	 */
	inline const int size() const{
		return children.size();
	}

	~ASTNodeList();

private:
	vector<ASTNode*> children;
};
}

#endif /* ASTNODELIST_H_ */
